package com.nbjtjc.safe.mapper.safe;

import com.nbjtjc.safe.model.safe.SafeBasis;
import com.nbjtjc.util.MyMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SafeBasisMapper extends MyMapper<SafeBasis> {

    List<SafeBasis> search(@Param("basis") SafeBasis basis);

    @Select("<script>"
            + "SELECT * FROM safe_basis WHERE id IN "
            + "<foreach item='item' index='index' collection='ids' open='(' separator=',' close=')'>"
            + "#{item}"
            + "</foreach>"
           + "</script>")
    List<SafeBasis> findByIds(@Param("ids") List<Integer> ids);
}